#include<bits/stdc++.h>
using namespace std;
typedef long double ld;
const int NN=1e6+4;
struct node
{
	int h,r1,r2;
	ld s;
}a[NN];
int main()
{
	freopen("wan.in","r",stdin);
	freopen("wan.out","w",stdout);
	int n;
	ld ans=0;
	scanf("%d",&n);
	stack<int>sta;
	for(int i=1;i<=n;i++)
	{
		scanf("%d%d%d",&a[i].h,&a[i].r1,&a[i].r2);
		while(sta.size()&&a[sta.top()].r2<=max(a[i].r1,a[i].r2))
		{
			int u=sta.top();
			if(a[u].r2<=a[i].r1)
				a[i].s=max(a[i].s,a[u].s+a[u].h);
			else
				a[i].s=max(a[i].s,max(a[u].s,max(a[u].s+a[u].h-a[i].h*1.0*(a[u].r2-a[i].r1)/(a[i].r2-a[i].r1),a[u].s+a[u].h*1.0*(a[i].r1-a[u].r1)/(a[u].r2-a[u].r1))));
			sta.pop();
		}
		if(sta.size())
		{
			int u=sta.top();
			a[i].s=max(a[i].s,max(a[u].s,max(a[u].s+a[u].h*1.0*(a[i].r2-a[u].r1)/(a[u].r2-a[u].r1)-a[i].h,a[u].s+a[u].h*1.0*(a[i].r1-a[u].r1)/(a[u].r2-a[u].r1))));
		}
		while(sta.size()&&a[sta.top()].s+a[sta.top()].h<=a[i].s+a[i].h)
			sta.pop();
		sta.push(i);
		ans=max(ans,a[i].s+a[i].h);
	}
	printf("%.7Lf",ans);
	return 0;
}
